<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<script type="text/javascript" src="/${initParam.context_root }/etc/js/jquery.js"></script>
<script type="text/javascript">
	$(document).ready(function(){
		$("#accountNum").focus();
	});
	function register(){
		if($("#accountNum").val()==''){
			alert("계좌번호는 필수 입력사항입니다.");
			$("#accountNum").focus();
			return;
		}
		if($("#depositor").val()==''){
			alert("예금주는 필수 입력사항입니다.");
			$("#depositor").focus();
			return;
		}
		if($("#bank").val()==''){
			alert("은행명은 필수 입력사항입니다.");
			$("#bank").focus();
			return;
		}
		
		$.ajax({
			url:"/${initParam.context_root }/myshop/registerPaymentManagement.do",
			type:"POST",
			data:$("#registerPaymentManagement").serialize(),
			dataType:"JSON",
			success:function(JSON){
				if(JSON.success==1){
					alert("등록이 완료되었습니다.");
				}else if(JSON.success==-1){
					alert("변경되었습니다.");
				}else{
					alert("실패");
				}
				window.close();
			}
		});
	}
</script>
</head>
<body>
<form id="registerPaymentManagement">
	<table>
		<tr>
			<td><label>계좌번호 : </label></td><td><input type="text" name="accountNum" id="accountNum"></td>
		</tr>
		<tr>
			<td>예금주 : </td><td><input type="text" name="depositor" id="depositor"></td>
		</tr>
		<tr>
			<td>은행명 : </td><td><input type="text" name="bank" id="bank"></td>
		</tr>
		<tr>
			<td colspan="2"><input type="button" value="등록" onclick="register()"></td>
		</tr>
	</table>
</form>
</body>
</html>